import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/documentDetails',
    },
    {
      path: '/redirect/:path*',
      component: () => import('@/views/redirect/index.vue'),
    },
    {
      path: '/login',
      name: 'login',
      meta: { navShow: false, cname: '登录页面' },
      component: () => import(/* webpackChunkName: "about" */
        '@/views/login/login.vue',
      ),
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      meta: { navShow: true, cname: '一级页面' },
      component: () => import(/* webpackChunkName: "about" */
        '@/views/dashboard/dashboard.vue',
      ),
    },
    {
      path: '/documentDetails',
      name: 'documentDetails',
      meta: { navShow: false, cname: '二级页面', requireAuth: true },
      component: () => import(/* webpackChunkName: "about" */
        '@/views/documentDetails/documentDetails.vue',
      ),
    },
    {
      path: '/about',
      name: 'about',
      meta: { navShow: false, cname: '子页面' },
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('@/views/About.vue'),
    },
    // {
    //   path: '/orderDetails',
    //   name: 'orderDetails',
    //   component: () => import(/* webpackChunkName: "about" */
    //     '@/views/orderDetails/orderDetails.vue',
    //   ),
    // },
    {
      path: '/auditingWait',
      name: 'auditingWait',
      meta: { navShow: true, cname: '一级页面', requireAuth: true },
      component: () => import('@/views/auditing/wait/wait.vue'),
    },
    {
      path: '/auditingComplete',
      name: 'auditingComplete',
      meta: { navShow: true, cname: '一级页面', requireAuth: true },
      component: () => import('@/views/auditing/complete/complete.vue'),
    },
    {
      path: '/auditingLaunch',
      name: 'auditingLaunch',
      meta: { navShow: true, cname: '一级页面', requireAuth: true },
      component: () => import('@/views/auditing/launch/launch.vue'),
    },
    {
      path: '/test',
      name: 'test',
      component: () => import(/* webpackChunkName: "about" */
        '@/views/test/test.vue',
      ),
    },
    {
      path: '/test2',
      name: 'test2',
      component: () => import(/* webpackChunkName: "about" */
        '@/views/test/test2.vue',
      ),
    },
    {
      path: '/404',
      name: '404',
      component: () => import('@/views/errorPage/404.vue'),
    },
    {
      path: '*',
      redirect: '/404',
    },
    // {
    //   path: '',
    //   component: Layout,
    //   redirect: 'dashboard',
    //   children: [{
    //     path: 'dashboard',
    //     component: () =>
    //                 import('@/views/dashboard/index'),
    //     name: 'Dashboard',
    //     meta: {
    //       title: 'dashboard',
    //       icon: 'dashboard',
    //       noCache: true
    //     }
    //   }]
    // },
  ],
});
